<%@ page import="com.portico.dept.solarch.Project" contentType="text/html;charset=UTF-8" %>
<html>
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
    <meta name="layout" content="main" />
    <title>Line Chart example</title>
    <gui:resources components="['chart']" mode='debug'/>
</head>


<body class='yui-skin-sam'>

<g:form action="list" controller="projectQuality">
  <g:hiddenField name="template" value="/chart/lineChartQuality"/>
  <g:select name="project.id" from='${Project.list()}'  optionKey="id" value="${project?.name}">Project Name </g:select>
  <g:select name="type" from='["Defect", "Change Request"]'>Issue Type</g:select>
  <g:select name= "subType" from="['Configured', 'Mixed', 'Product','Unknown']" >Issue Subtype</g:select>
  <g:select name= "issueStatus" from="['ALL', 'OPEN']" >Issue Subtype</g:select>
</g:form>

<g:if test="projectQualityMapList">
    <h2>${params?.chartTitle}</h2>

    <div id='lineChart' style="width:600px; height: 400px"></div>

    <gui:lineChart
        renderTo="lineChart"
        data="${projectQualityMapList}"
        seriesDefs="[
            [
                blockerCount:'Blockers',
                style:[
                        color: 0xff0000,
                        lineSize: 5,
                        size: 10
                ]
            ],
            [
                criticalCount:'Criticals',
                style:[
                        color: 0xff0000,
                        lineSize: 5,
                        size: 10
                ]
            ],
            [
                majorCount:'Majors',
                style:[
                        color: 0xff0000,
                        lineSize: 5,
                        size: 10
                ]
            ],
            [
                minorCount:'Minors',
                style:[
                        color: 0xff0000,
                        lineSize: 5,
                        size: 10
                ]
            ],

            [utilities:'Utilities'],
            [utilities:'Rent']
        ]"
        yAxis="[
            type:'numeric',
            format: [prefix:'$', thousandsSeparator: ',', decimalPlaces: 2],
            config:[
                minimum:800,
                maximum:940
            ]
        ]"
        style="[
            legend: [display: 'right'],
            background: [
                color: 0xFF0FF0,
                alpha: 0.1
            ],
            padding: 20,
            border: [
                color: 0x995566,
                size: 2
            ],
            font: [
                name: 'Verdana',
                color: 0x995566,
                size: 12
            ]
        ]"
    />
  </g:if>

</body>
</html>